package avicit.bdp.dcs.rule.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * @金航数码科技有限责任公司
 * @作者：liyb
 * @邮箱：liyb@avic-digital.com
 * @创建时间：2020-08-06 10:45
 * @类说明：数据迁移同步批量修改列名规则实体类
 * @修改记录：
 */
@ApiModel(value = "ColumnRuleDTO", description = "bdp_dcs_column_rule")
@Table(name = "bdp_dcs_column_rule")
public class ColumnRuleDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    // 主键
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    // 任务id
    @LogField
    @ApiModelProperty(value = "任务id")
    @FieldRemark(column = "task_id", field = "taskId", name = "任务ID")
    @Column(name = "task_id")
    private String taskId;

    // 规则类型，添加前后缀：1
    @LogField
    @ApiModelProperty(value = "规则类型，添加前后缀：1")
    @FieldRemark(column = "rule_type", field = "ruleType", name = "规则类型")
    @Column(name = "rule_type")
    private Integer ruleType;

    // 规则名称：修改规则1，修改规则2....
    @LogField
    @ApiModelProperty(value = "规则名称：修改规则1，修改规则2....")
    @FieldRemark(column = "name", field = "name", name = "规则名称")
    @Column(name = "name")
    private String name;

    // 前缀
    @LogField
    @ApiModelProperty(value = "前缀")
    @FieldRemark(column = "prefix", field = "prefix", name = "前缀")
    @Column(name = "prefix")
    private String prefix;

    // 后缀
    @LogField
    @ApiModelProperty(value = "后缀")
    @FieldRemark(column = "suffix", field = "suffix", name = "后缀")
    @Column(name = "suffix")
    private String suffix;

    // 组织机构代码
    @ApiModelProperty(value = "组织机构代码")
    @FieldRemark(column = "org_identity", field = "orgIdentity", name = "组织机构代码")
    @Column(name = "org_identity")
    private String orgIdentity;

    // 密级
    @ApiModelProperty(value = "密级")
    @FieldRemark(column = "secret_level", field = "secretLevel", name = "密级")
    @Column(name = "secret_level")
    private String secretLevel;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public Integer getRuleType() {
        return ruleType;
    }

    public void setRuleType(Integer ruleType) {
        this.ruleType = ruleType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPrefix() {
        return prefix;
    }

    public void setPrefix(String prefix) {
        this.prefix = prefix;
    }

    public String getSuffix() {
        return suffix;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    @Override
    public String getOrgIdentity() {
        return orgIdentity;
    }

    @Override
    public void setOrgIdentity(String orgIdentity) {
        this.orgIdentity = orgIdentity;
    }

    @Override
    public String getSecretLevel() {
        return secretLevel;
    }

    @Override
    public void setSecretLevel(String secretLevel) {
        this.secretLevel = secretLevel;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "列规则管理";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "列规则";
        } else {
            return super.logTitle;
        }
    }

}